home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / 422mods.zip / LLR001.422 < prev    next >
Text File  |  1993-03-07  |  13KB  |  443 lines

  1. [LLR001.MOD] 256 Color Mod, with MCI codes!
  2. Leisure Larry #1 @18860
  3. Wed Mar 03 19:01:50 1993
  4. 7[1Mess Stat7] 1Reply Requested, Thanks
  5. 7────────────────────────────────────────────────────────────────────────────
  6. ┌────────────────────────────────────────────────────────────────────────────┐
  7. │ Mod Name  : LLR001.MOD                   Mod Author: Leisure Larry #1      │
  8. │ Difficulty: Mostly block read            Freedom/Dark/Warp/Fed/Vital @8852 │
  9. │ WWIV Version: 4.22                       WWIV @8869, Ice @8861, Link @18860│
  10. │ Files Effected: VARS.H, COM.C, BBSUTL.C (Optional BBS.C, MSGBASE.C)        │
  11. │ Description: 256 Color Mod, + MCI Codes! Date: March 2, 1993               │
  12. └────────────────────────────────────────────────────────────────────────────┘
  13.   This Mod was formerly the SSMOD04a.MOD, but hasn't been updated for quite
  14.   sometime!  (SSMOD04A.MOD, by Hoser of Sweven Swede's BBS) Therefore, his
  15.   original mod/idea deserves all the credit, I've just enhanced/updated it for
  16.   for v4.22.
  17.  
  18.   Have you ever wished that WWIV could handle more than 8 colors while
  19.   writting a message(single line editor)?  Just think, while in a message
  20.   hitting Ctrl-\ + (a 2 digit code) would then make available up to 256
  21.   different Foreground to background color configurations (including Blinking
  22.   and Intensified!).
  23.       
  24.     With the two digit code going like this.
  25.     (Ctrl-\)+xx
  26.     First x :
  27.       Background color.
  28.       0-7 are the standard Background colors.
  29.       8,9,A-F are those same standard colors BUT with the Foreground
  30.         set to blinking.
  31.     Second x :
  32.       Foreground color.
  33.       0-7 are the standard (blah) colors for the foreground.
  34.       8,9,A-F are those same colors with Intensity turned on!
  35.  
  36.   * Note: Can also be used in other places.. (ie..Random Quotes, Message
  37.     titles).. Also, if you know the equilvalent control keys, you can
  38.     incorporate these 256 color codes into your source code.  For the Heart
  39.     shape charcters, you generally use Cntl-P Cntl-C (in Turbo C++).  To
  40.     obtain the character that is equilvalent to the heart shape, but for the
  41.     256 color codes... you would use Cntl-P Alt-19 then the 2 digit color
  42.     code of your choice.  A couple of examples, within the source code where
  43.     you would generally use your Cntl-P Cntl-C's (heart shapes) would be in
  44.     the...
  45.        - npr's, outstr's, sprintf's...
  46.     just substitute them with your own color codes of Cntl-P Alt-19 + 2 digits.
  47.     Another place... you can now use them in your external string files...
  48.     The ESM will allow you to input the same Cntl-P Cntl-C heart shapes, so
  49.     you can use your Cntl-P Alt-19 + 2 digit color codes as well. It works
  50.     for me.
  51.  
  52.   Sounds swell don't it?
  53.   
  54. Then install this MOD.
  55.  
  56.   This has been updated for WWIV v4.22 source and may work fine with v4.21a.
  57.  
  58.   ▄▄▄▄▄▄▄▄
  59.   ▌BONUS!▐ An MCI Ctrl-P mod to show the current users
  60.   ▀▀▀▀▀▀▀▀ Control-P N for Current User's NAME
  61.        Control-P R for Current User's REAL NAME
  62.        Control-P S for Current User's STREET
  63.        Control-P B for Current User's CITY
  64.        Control-P E for Current User's STATE
  65.        Control-P F for Current User's ZIPCODE
  66.        Control-P # for Current User's VOICEPHONE
  67.        Control-P P for Current User's DATAPHONE
  68.        Control-P @ for Current User's PASSWORD
  69.        Control-P T for Current User's TIME
  70.        Control-P D for Current User's DATE
  71.  
  72.            To incorporate into anything that uses inli();
  73.            You will inadvertantly install it into your BBS.
  74.            (so sorry if you dont want it)
  75.            256 color codes work with MCI's, just as well. :)
  76.            If you have a Random Quote Mod... You'll love these
  77.            MCI's!
  78.  
  79.        Legend
  80.        = existing code
  81.        - delete existing code
  82.        + Add code
  83.  
  84. ──╢▌Step 1▐╟───────────────────────────────────────────────────────────────
  85.  
  86.        Back up your source!
  87.  
  88. ──╢▌Step 2▐╟───────────────────────────────────────────────────────────────
  89.  
  90.   Load up VARS.H
  91.  
  92.   Make the following addition for "ctrlzc".....
  93.  
  94. + __EXTRN__ unsigned char actsl, andwith, checksum, ctrlzc; /* Add ctrlzc */
  95.  
  96.   Save VARS.H
  97.  
  98. ──╢▌Step 3▐╟───────────────────────────────────────────────────────────────
  99.  
  100.   Load up COM.C and find...
  101.  
  102. void outchr(char c)
  103.  
  104.   Then make the appropriate changes to the void so that the following
  105.   changes are there!
  106.  
  107. -  if (change_color) {                     Delete this portion
  108. -    change_color = 0;                     from your source, and
  109. -    if ((c >= '0') && (c <= '7'))         replace with the below.
  110. -      ansic(c - '0');                     Just cut and paste!
  111. -    return;
  112. -  }
  113.  
  114. +  if (change_color==1) {
  115. +    change_color = 0;
  116.  
  117. +    if ((c >= '0') && (c <= '7') || (c=='N') || (c=='R') ||
  118. +      (c=='S') || (c=='B') || (c=='E') || (c=='F') || (c=='P') ||
  119. +      (c=='D') || (c=='T') || (c=='#') || (c=='@')) {
  120. +
  121. +      if ((c>='0') && (c<='7')) ansic(c-'0');
  122. +      if (c=='N') outstr(thisuser.name);
  123. +      if (c=='R') outstr(thisuser.realname);
  124. +      if (c=='S') outstr(thisuser.street);
  125. +      if (c=='B') outstr(thisuser.city);
  126. +      if (c=='E') outstr(thisuser.state);
  127. +      if (c=='F') outstr(thisuser.zipcode);
  128. +      if (c=='P') outstr(thisuser.dataphone);
  129. +      if (c=='D') outstr(date());
  130. +      if (c=='T') outstr(times());
  131. +      if (c=='#') outstr(thisuser.phone);
  132. +      if (c=='@') outstr(thisuser.pw);
  133. +    }
  134. +    return;
  135. +  }
  136. +  if ((change_color==2) || (change_color==4)) {
  137. +    if (change_color==2) {
  138. +      change_color=4;
  139. +      if ((c>='0') && (c<='9')) { c=(c-48); }
  140. +      else if ((c>='A') && (c<='F')) { c=(c-55); }
  141. +      ctrlzc=(c*16);
  142. +    } else if (change_color==4) {
  143. +      change_color=0;
  144. +      if ((c>='0') && (c<='9')) { c=(c-48); }
  145. +      else if ((c>='A') && (c<='F')) { c=(c-55); }
  146. +      ctrlzc=(ctrlzc+c);
  147. +      if (okansi()) setc(ctrlzc);
  148. +    }
  149. +    return;
  150. +  }
  151.  
  152. =  if (c == 3) {                  /* existing code, leave alone */
  153. =    change_color = 1;
  154. =    return;
  155. =  }
  156.  
  157. +  if (c == 19) {                 /* add these 4 lines of code */
  158. +    change_color = 2;
  159. +    return;
  160. +  }
  161.  
  162.    Save COM.C !
  163.  
  164. ──╢▌Step 4▐╟───────────────────────────────────────────────────────────────
  165.  
  166.   Next Load up BBSUTL.C
  167.  
  168.   Find the ...
  169.  
  170. void inli(char *s, char *rollover, int maxlen, int crend)
  171.  
  172.   First add to the unsigned char list so that it says...
  173.  
  174. + unsigned char ch,ch2;      /* add ch2 */
  175.  
  176. further down, just exchange each of these case statements, and add the
  177. extra case 28: Cntl-\  this is what you will use to call the 256 colors.
  178.  
  179. ■ Exchange your "case 8: /* Backspace */" statement with mine.
  180.  
  181.           case 8:  /* Backspace */
  182.         if (cp) {
  183.           if (s[cp-2]==3) {
  184.         if ((s[cp-1]=='N') || (s[cp-1]=='R') || (s[cp-1]=='S') ||
  185.           (s[cp-1]=='B') || (s[cp-1]=='E') || (s[cp-1]=='F') ||
  186.           (s[cp-1]=='P') || (s[cp-1]=='D') || (s[cp-1]=='T') ||
  187.           (s[cp-1]=='#') || (s[cp-1]=='@'))
  188.            backspace();
  189.            cp-=2;
  190.            ansic(0);
  191.         } else
  192.           if (s[cp-3]==19) {
  193.             cp-=3;
  194.             ansic(0);
  195.           } else
  196.             if (s[cp-1]==8) {
  197.               cp--;
  198.               outchr(32);
  199.             } else {
  200.               cp--;
  201.               backspace();
  202.             }
  203.         }
  204.         break;
  205.  
  206. ■ and then exchange your "case 23: /* Ctrl-W */" statement with mine.
  207.  
  208.       case 23: /* Ctrl-W */
  209.         if (cp) {
  210.           do {
  211.         if (s[cp-2]==3) {
  212.           if ((s[cp-1]=='N') || (s[cp-1]=='R') || (s[cp-1]=='S') ||
  213.             (s[cp-1]=='B') || (s[cp-1]=='E') || (s[cp-1]=='F') ||
  214.             (s[cp-1]=='P') || (s[cp-1]=='D') || (s[cp-1]=='T') ||
  215.             (s[cp-1]=='#') || (s[cp-1]=='@'))
  216.           cp-=2;
  217.           ansic(0);
  218.         } else
  219.           if (s[cp-3]==19) {
  220.             cp-=3;
  221.             ansic(0);
  222.           } else
  223.             if (s[cp-1]==8) {
  224.               cp--;
  225.               outchr(32);
  226.             } else {
  227.               cp--;
  228.               backspace();
  229.             }
  230.           } while ((cp) && (s[cp-1]!=32) && (s[cp-1]!=8));
  231.         }
  232.         break;
  233.  
  234. ■ and then exchange your "case 16: /* Ctrl-P */" statement with mine.
  235.  
  236.       case 16: /* Ctrl-P */
  237.         if (cp<maxlen-1) {
  238.           ch=getkey();
  239.           if (((ch>='0') && (ch<='7')) || (ch=='n') || (ch=='r') ||
  240.         (ch=='s') || (ch=='b') || (ch=='e') || (ch=='f') ||
  241.         (ch=='p') || (ch=='d') || (ch=='t') || (ch=='N') ||
  242.         (ch=='R') || (ch=='S') || (ch=='B') || (ch=='E') ||
  243.         (ch=='F') || (ch=='P') || (ch=='D') || (ch=='T') ||
  244.         (ch=='#') || (ch=='@')) {
  245.         s[cp++]=3;
  246.         s[cp++]=upcase(ch);
  247.         if ((ch >='0') && (ch<='7')) ansic(ch-'0');
  248.           if ((ch=='N') || (ch=='n')) {
  249.             i = curatr;
  250.             setc(139);
  251.             outstr("Name");
  252.             setc(i);
  253.           }
  254.           if ((ch=='R') || (ch=='r')) {
  255.             i = curatr;
  256.             setc(139);
  257.             outstr("Real Name");
  258.             setc(i);
  259.           }
  260.           if ((ch=='S') || (ch=='s')) {
  261.             i = curatr;
  262.             setc(139);
  263.             outstr("Street");
  264.             setc(i);
  265.           }
  266.           if ((ch=='B') || (ch=='b')) {
  267.             i = curatr;
  268.             setc(139);
  269.             outstr("City");
  270.             setc(i);
  271.           }
  272.           if ((ch=='E') || (ch=='e')) {
  273.             i = curatr;
  274.             setc(139);
  275.             outstr("State");
  276.             setc(i);
  277.           }
  278.           if ((ch=='F') || (ch=='f')) {
  279.             i = curatr;
  280.             setc(139);
  281.             outstr("Zipcode");
  282.             setc(i);
  283.           }
  284.           if ((ch=='P') || (ch=='p')) {
  285.             i = curatr;
  286.             setc(139);
  287.             outstr("DataPhone");
  288.             setc(i);
  289.           }
  290.           if ((ch=='D') || (ch=='d')) {
  291.             i = curatr;
  292.             setc(139);
  293.             outstr("Date");
  294.             setc(i);
  295.           }
  296.           if ((ch=='T') || (ch=='t')) {
  297.             i = curatr;
  298.             setc(139);
  299.             outstr("Time");
  300.             setc(i);
  301.           }
  302.           if ((ch =='#')) {
  303.             i = curatr;
  304.             setc(139);
  305.             outstr("VoicePhone");
  306.             setc(i);
  307.           }
  308.           if ((ch =='@')) {
  309.             i = curatr;
  310.             setc(139);
  311.             outstr("Password");
  312.             setc(i);
  313.           }
  314.  
  315.           }
  316.         }
  317.         break;
  318.  
  319. ■ and then add this whole section "case 28: /* Ctrl-\ */"...after your
  320.   case 16: Cntl-P.
  321.  
  322.       case 28: /* Ctrl-\ */
  323.         if (cp<maxlen-1) {
  324.           ch=getkey();
  325.           ch2=getkey();
  326.           if ((((ch>='0') && (ch<='9')) || ((ch>='A') && (ch<='F')) ||
  327.         ((ch>='a') && (ch<='f'))) && (((ch2>='0') && (ch2<='9')) ||
  328.         ((ch2>='A') && (ch2<='F')) || ((ch2>='a') && (ch2<='f')))) {
  329.         s[cp++]=19;
  330.         if ((ch>='0') && (ch<='9'))
  331.           { i=(ch-48); s[cp++]=ch; }
  332.         else if ((ch>='A') && (ch<='F'))
  333.           { i=(ch-55); s[cp++]=ch; }
  334.         else if ((ch>='a') && (ch<='f'))
  335.           { i=(ch-87); s[cp++]=(ch-32); }
  336.         else break;
  337.         if ((ch2>='0') && (ch2<='9'))
  338.           { i1=(ch2-48); s[cp++]=ch2; }
  339.         else if ((ch2>='A') && (ch2<='F'))
  340.           { i1=(ch2-55); s[cp++]=ch2; }
  341.         else if ((ch2>='a') && (ch2<='f'))
  342.           { i1=(ch2-87); s[cp++]=(ch2-32); }
  343.         else break;
  344.         if (okansi()) {
  345.           i=i*16;
  346.           i1=i+i1;
  347.           setc(i1);
  348.         }
  349.           }
  350.         }
  351.         break;
  352.  
  353.   Save BBSUTL.C!
  354.  
  355. ──╢▌Step 5A▐╟───(optional*)────────────────────────────────────────────────
  356.  
  357.   *-This part will make a list of the codes and their colors
  358.     from the BBS mainmenu.  Add this where ever you wish.
  359.     Another place for it would be in the editor itself.
  360.     Sorta like "/HELP" will pop up a help screen make
  361.     the color choices in the help screen or a completely
  362.     separate command like "/COLOR".
  363.  
  364.   From the main menu in the BBS type "//ANSITEST" to see it!
  365.  
  366.   Now load up BBS.C
  367.   find the part labeled...
  368.  
  369. void mainmenu()
  370.  
  371.   add the following...
  372.  
  373. = if ((strcmp(s,"UPLOAD")==0) && (actsl>10))    /* existing code */
  374. =   upload_post();
  375.  
  376. + if (strcmp(s,"ANSITEST")==0) {                /* allows 256 color   */
  377. +   nl();                                       /* codes to be viewed */
  378. +   sysoplog("ANSITEST");                       /* from Main Menu     */
  379. +   for (i=0; i<255; i++) {
  380. +     strcpy(s2,"");
  381. +     sprintf(s2,":%x",i);
  382. +     setc(i);
  383. +     outstr(s2);
  384. +     setc(7);
  385. +     if(((i+1)%16)==0) { setc(0); nl(); }
  386. +   }
  387. + }
  388.  
  389. = if (strcmp(s,"QSCAN")==0) {             /* existing code */
  390. =   nl();
  391. =   prt(5,"Clear Q-Scan pointers? ");
  392. =   if (yn()) {
  393.  
  394.   Save BBS.C!
  395.  
  396. ──╢▌Step 5B▐╟───(optional*)────────────────────────────────────────────────
  397.  
  398.   From within the Single line editor "/COLOR" to see it!
  399.  
  400.   Now load up MSGBASE.C
  401.   find the part labeled "void inmsg(...)"
  402.  
  403.   Search for the following....
  404.  
  405. =     if (s[0]=='/') {
  406. =       if (stricmp(s,"/HELP")==0) {
  407. =         savel=0;
  408. =         printmenu(2);
  409. =       }
  410. +       if (stricmp(s,"/COLOR")==0) {   /* add this optional section */
  411. +         savel=0;                      /* of code to show 256 color */
  412. +      for (i=0; i<255; i++) {       /* codes from the Single line */
  413. +      strcpy(s2,"");                /* editor */
  414. +      sprintf(s2,":%x",i);
  415. +      setc(i);
  416. +      outstr(s2);
  417. +      setc(7);
  418. +      if(((i+1)%16)==0) { setc(0); nl(); }
  419. +      }
  420. +     nl();
  421. +    }
  422. =    if (stricmp(s,"/LI")==0) {
  423. =      savel=0;
  424. =      prt(1,get_string(630));
  425. =          i1=yn();
  426.  
  427. ──╢▌Step 6▐╟──(END)────────────────────────────────────────────────────────
  428.  
  429.   Compile the BBS!
  430.  
  431.   The most unique thing about this mod is that you can virtually
  432.   Colorize the BBS to your choice of colors, and can hardcode MCI's,
  433.   if desired.
  434.  
  435.   Generic Disclaimer!  If it melts your system... I'm sorry, You installed
  436.   it!
  437.  
  438.   If you have suggestions on improving the mod, fine, I'd like to hear
  439.   them.  I can be located through any of the listed networks, or [ASV] is
  440.   available for High Speed SysOps on my system.
  441.  
  442.                 Leisure Larry
  443.